<?php
require_once 'test-00-inc.php';

start('XML source manipulations');

test('Getting inner source returns string:','
    $html->body->inner_source()
');

test('Setting inner source is chainable:','
    $html->body
        ->set_attribute("class", "BODY")
        ->set_inner_source("<h1>TEST ELEMENT SOURCE</h1><p>OK</p><p>THE END</p>")
        ->p->set_attribute("class", "PARA")
');

source($html);

test('Getting outer source returns string:','
    $html->body->p[0]->source()
');

test('Setting outer source is chainable:','
    $test = $html->body->p[0]
        ->set_source("\n<span><b>REPLACE</b></span>\n<span>ELEMENT<br/>SOURCE</span>\n")
        ->set_attribute("align", "center")
');
foreach(nz($test) as $key => $item) {
    echo "$key => "; var_dump($item);
}

result($html);
